// StateBase.ts
import { _decorator, Component } from "cc";

export abstract class StateBase<T> extends Component {
  public abstract get state(): T;
  // 进入状态前的预处理逻辑
  public abstract beforeEnter(...args: any[]): void;
  // 进入状态时的逻辑
  public abstract enter(...args: any[]): void;

  // 退出状态时的逻辑
  public abstract exit(): void;

  // 状态更新逻辑（每帧调用）
  public abstract update(dt: number): void;
}
